package byx.container.annotation.extension.impl;

import byx.container.core.Container;
import byx.container.core.utils.CastUtils;

import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;

public abstract class ConditionalAnnotationHandler<T extends Annotation> {
    public Class<T> getAnnotationType() {
        return CastUtils.cast(((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]);
    }

    public abstract boolean needToRegister(T annotation, Container container);
}
